<%-- 
    Document   : createProduct
    Created on : Jan 2, 2013, 3:06:13 PM
    Author     : Nguyen Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/product.css"/>
        <link rel="stylesheet" type="text/css" href="../css/style.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>   
        <!--        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery-1.7.2.min.js"></script>      -->
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <style>
            .openS100{
                cursor: pointer;
            }
        </style>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            
            $j(document).ready(function(){
                $j('.text_search').live('keyup',function(){
                    if($j('.text_search').val() == ""){
                        $j('.row-product').show();
                                   
                    }else{
                        $j('.row-product').hide();
                        $j('.row-product').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.text_search').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                }); 
            });
        </script>
        <style>
            .imgFancybox img{
                height: 26px;
                width: 30px;
            }
        </style>
    </head>

    <body>

        <a4j:form>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.TOU_LST_TOUR}'></div>" escape="false"/> 
            <div id="content">
                <div id="menu_top">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span><h:outputText value="#{locale.area}"/></span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Outlets</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>
                                <li><a href="#"><span>Ban Điều Hành</span></a></li>
                                <li><a href="#"><span>Nhóm IT</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                        <div style="float:left;margin-left: 2px;" class="imgFancybox">
                        <h:outputLink  rendered="#{loginSession.right.TOU_TOUR_CRE}" value="addS400forTour.jsp?action=add&page=listTour.jsp&SV216=0&height=250px&width=700px"  styleClass="fancybox">

                            <h:graphicImage title="Tạo sản phẩm Tour" style="float:left;" value="../images/addnew.png"/>
                        </h:outputLink>
                    </div>
                    <div class="groupcontanersearch">

                        <h:inputText style="  float: left;height: 25px; margin-left: 0;width: 86%;" value="" onfocus="if(this.value=='Nhập từ khóa')this.value='';" styleClass="text_search" />
                        <div class="buttonsearch" style="margin-left:5px; float:left; border-radius:8px 8px 8px 8px; ">
                            <%--   <div class="group cssgroup" style="height:167px !important;">
                                   <h:selectOneRadio layout="pageDirection" value="#{TourBean.typeSearch}" styleClass="feild_sex"  style="margin-left:5px; margin-top:5px; padding:15px; width:195px; height:120px;"   >
                                       <f:selectItem itemValue="5" itemLabel="#{locale.all}" />
                                       <f:selectItem itemValue="1" itemLabel="Tên tour"/>
                                       <f:selectItem itemValue="2" itemLabel="Mã tour"/>
                                       <f:selectItem itemValue="3" itemLabel="GIT"/>
                                       <f:selectItem itemValue="4" itemLabel="FIT"/>
                                       <f:selectItem itemValue="6" itemLabel="OP"/>
                                       <f:selectItem itemValue="7" itemLabel="CC"/>
                                   </h:selectOneRadio>
                                   <h:commandButton      action="#{TourBean.reload}" value="#{locale.search}" style="margin-left:75px; margin-top:5px;" styleClass="buttonsearch2">
                                   </h:commandButton>
                               </div> --%>
                        </div>
                    </div>
                </div>
                <div id="content_detail">

                    <div class="content_right">
                        <div class="content" id="">
                            <%--      <div style="height: 29px;background-color: #4A5763;width: 920px;line-height: 29px;">
                                      <div style="margin-left: 15px;color: white;">
                                          <h:outputText value="DANH SÁCH SẢN PHẨM TOUR HIỆN CÓ" style="text-transform:uppercase"/>
                                      </div>

                        </div> --%>
                            <div class="list_content" style="margin-top: 0;" >
                                <h:panelGroup >
                                    <a4j:repeat  value="#{SPBean.listS400}" var="item" rowKeyVar="row" >

                                        <div class="row-product" lang="<h:outputText value="#{item.ps400}"/>">
                                            <div class="product1">
                                                <div class="product_id">
                                                    <h:outputText value="#{row +1}" >
                                                        <f:convertNumber  pattern="##000"></f:convertNumber>
                                                    </h:outputText>
                                                </div>
                                            </div>
                                            <div class="product2">
                                                <div class="product_info">
                                                    <h:outputText value="#{item.sv401} "/> 
                                                </div>

                                            </div>
                                            <div class="product3">
                                                <div class="product_f">
                                                    <h2><label ><h:outputText value="Điểm khởi hành"/>:&nbsp; </label> <h:outputText style="font-style:italic;" value="#{item.AV001F} "/></h2>
                                                </div>
                                                <div class="product_e"> 
                                                    <label ><h:outputText value="Điểm đến"/>:&nbsp; </label> <h:outputText style="font-style:italic;" value="#{item.AV001T} "/>
                                                </div>
                                            </div>
                                            <div class="product4">
                                                <div class="product_price"> 
                                                    <label ><h:outputText value="Giá tour"/>:&nbsp; </label>                                         
                                                    <span> <h:outputText value=" #{item.price}" style="font-style:italic;"  >     <f:convertNumber type="currency" currencyCode="EUR"/> </h:outputText></span> 
                                                </div>
                                                <div class="product_date"> 
                                                    <h2><label ><h:outputText value="Số ngày" />:&nbsp; </label><span><h:outputText value=" #{item.sn406}" style="font-style:italic;"  /></span></h2>
                                                </div>
                                                <div class="product_count"> 
                                                    <label ><h:outputText value="Số lượng"/>:&nbsp; </label><span><h:outputText  style="font-style:italic;"  value=" #{item.sn408}" />
                                                </div>

                                            </div>
                                            <div class="product5">
                                                <div class="product_action"> 
                                                    <h:outputLink rendered="#{loginSession.right.TOU_TOUR_MOD}"  value="addS400forTour.jsp?action=editS400&ps400=#{item.ps400}&height=250px&width=700px" styleClass="fancybox add_new" id="fancybox22">
                                                        <img src="../images/edit.png" alt="edit" title="edit"/>
                                                    </h:outputLink>                                          

                                                    <h:outputLink  rendered="#{loginSession.right.TOU_TOUR_DEL}"   value="delete.jsp?id=#{item.ps400}&flag=S400&width=300&height=150" styleClass="fancybox">
                                                        <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                    </h:outputLink> 
                                                </div>
                                                <div class="product_detail"> 
                                                    <h:panelGroup rendered="#{loginSession.right.TOU_TOUR_TCK}" ><img style="float: right;margin-top: 0px;" src="../images/bg_button2.png" alt="Sản phẩm" title="Sản phẩm" class="openS100 s100 s100<h:outputText value="#{item.ps400}"/>" id="<h:outputText value="#{item.ps400}"/>" /></h:panelGroup>
                                                    <h:panelGroup rendered="#{loginSession.right.TOU_TOUR_CAL}"><a style="float: right;margin-right: 10px;" href="codeproductTour.jsp?action=detailTour&FS400=<h:outputText value="#{item.ps400}"/>"><span><h:outputText value="Lịch tổ chức Tour"/></span></a> </h:panelGroup> 
                                                </div>

                                            </div>
                                            <div style="width: 22%;font-size: 9px;float: right;"><h:outputText value="#{item.sl419}"/>(<h:outputText value="#{item.sl418}"/>)</div>
                                        </div>    
                                        <div class="addS100">                                                


                                        </div>
                                    </a4j:repeat>

                                </h:panelGroup> 

                            </div>
                        </div>

                    </div>
                </div>
            </a4j:form>
    </body>
</html>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
            
    $j(document).ready(function(){
        initThickBox('.thickbox');
                
        $j('input#dateRepeat').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
        $j(".historyContent").css("display","none");     
        $j('.openS100').live('click',function(){
            var ps400 = $j(this).parent().parent().parent().attr('lang');                      
            $j('.addS100').slideUp();
            $j('.addS100').html(''); 
            var s100 = $j(this).parent().parent().parent().next();                    
            if(s100.hasClass('active')){
                s100.removeClass('active');
            }else{
                                                 
                s100.removeClass('active');
                s100.addClass('active');                                               
                // showPleaseWait();      
              
                $j.post('detailS100.jsp?action=detailS100&ps400='+ps400,function(data){  
                   
                    if(data !=null){
                        //                                alert(sms.attr('class'));
                        s100.css('min-height','150px');
                        s100.html(data);
                        s100.slideDown();
                        //  hidePleaseWait();
                    }
                });
                //                    }
                     
            }
        });
        
        slide = gup( 'tab' );
        if(slide != null && slide !=undefined && slide.length > 0){
            //alert(slide);
            //$j('.'+tab).parent().parent().parent().parent().parent('.tabs_menu').css('display','block');
            $j('.'+slide).trigger('click') ;

        }
                
    });
    function adds100_addform(){
        var sn104 = $j('.selectSN104').val();
        var sn107 = $j('.selectSN107').val();
        alert("aaaa" +sn104);
    }
</script>